﻿@inject ITreeService TreeService

<div class="top-row navbar navbar-dark">
    @if (TreeRoot != null)
    {
        <div class="logo">
            <NavigationLink NewState="@TreeRoot.State">@TreeRoot.Name</NavigationLink>
        </div>
    }

    @if (CustomLoginStatus != null)
    {
        @CustomLoginStatus
    }
</div>

@code {
    TreeRootUI? TreeRoot;

    [CascadingParameter(Name = "CustomLoginStatus")]
    private RenderFragment? CustomLoginStatus { get; set; }

    protected override void OnInitialized()
    {
        TreeRoot = TreeService.GetRoot();
    }
}
